﻿/*
* 作 者: 王冬冬
* 公 司: 墨宇天城
* 创建时间: 2016/3/22 16:55:25
* 说明:  
*/

using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class LabController : MonoBehaviour
{
    [HideInInspector]
    public Text lblWin;
    [HideInInspector]
    public Text lblCoin;
    [HideInInspector]
    public Text lblBigOrSmall;

    [HideInInspector]
    public int winNum;
    
    [HideInInspector]
    public int coinNum;
    [HideInInspector]
    public int bigorsamllNum;
    void Awake()
    {
        lblWin = this.transform.Find("lblWin").GetComponent<Text>();
        lblCoin = this.transform.Find("lblCoin").GetComponent<Text>();
        lblBigOrSmall = this.transform.Find("BigOrSmall/lblBigOrSmall").GetComponent<Text>();

    }
    void Start()
    {
        lblWin.text = "0";
        lblBigOrSmall.text = "0";
    }
    public void CoinInit(int num)
    {
        coinNum = num;
        lblCoin.text = coinNum.ToString();
    }
    public void AddWin(int num)
    {
        winNum += num;
        lblWin.text = winNum.ToString();
    }
    public void DelWin(int num)
    {
        winNum -= num;
        lblWin.text = winNum.ToString();
    }
    public void AddCoin(int num)
    {
        coinNum += num;
        lblCoin.text = coinNum.ToString();
    }
    public void DelCoin(int num)
    {
        coinNum -= num;
        if (coinNum <= 0)
            coinNum = 0;
        lblCoin.text = coinNum.ToString();
    }
    public void SetBigOrSmall(int num)
    {
        lblBigOrSmall.text = num.ToString();
    }
}